# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "go_default_library",
    srcs = [
        "actions.go",
        "build.go",
        "job.go",
        "main.go",
        "master.go",
        "replay.go",
        "report.go",
        "stash.go",
        "subject.go",
        "trace.go",
        "upload.go",
        "web.go",
    ],
    importpath = "github.com/google/gapid/cmd/robot",
    visibility = ["//visibility:private"],
    deps = [
        "//core/app:go_default_library",
        "//core/app/crash:go_default_library",
        "//core/git:go_default_library",
        "//core/log:go_default_library",
        "//core/net/grpcutil:go_default_library",
        "//core/os/device:go_default_library",
        "//core/os/device/host:go_default_library",
        "//core/os/file:go_default_library",
        "//core/os/flock:go_default_library",
        "//test/robot/build:go_default_library",
        "//test/robot/job:go_default_library",
        "//test/robot/master:go_default_library",
        "//test/robot/monitor:go_default_library",
        "//test/robot/record:go_default_library",
        "//test/robot/replay:go_default_library",
        "//test/robot/report:go_default_library",
        "//test/robot/scheduler:go_default_library",
        "//test/robot/search/script:go_default_library",
        "//test/robot/stash:go_default_library",
        "//test/robot/stash/grpc:go_default_library",
        "//test/robot/stash/local:go_default_library",
        "//test/robot/subject:go_default_library",
        "//test/robot/trace:go_default_library",
        "//test/robot/web:go_default_library",
        "@com_github_golang_protobuf//proto:go_default_library",
        "@com_github_golang_protobuf//ptypes:go_default_library_gen",
        "@org_golang_google_grpc//:go_default_library",
    ],
)

go_binary(
    name = "robot",
    data = select({
        "//tools/build:no-android": [],
        "//conditions:default": [
            "//gapidapk/android/apk:arm64-v8a.apk",
            "//gapidapk/android/apk:armeabi-v7a.apk",
            "//gapidapk/android/apk:x86.apk",
        ],
    }),
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)
